/**
 ******************************************************************************
 * @file    sh30f9820_interrupt.c
 * @author  sinowealth
 * @version V1.1.0
 * @date    19-July-2021
 * @brief   Main Interrupt Service Routines.
 *          This file provides template for all exceptions handler and
 *          peripherals interrupt service routine.
 ******************************************************************************
 */

/* Includes ------------------------------------------------------------------*/
#include "sh30f9820.h"
#include "Api_Tick.h"
#include "Api_Knob.h"


void NMI_Handler(void) __attribute__((noreturn));
void HardFault_Handler(void) __attribute__((noreturn));
void SVC_Handler(void);
void PendSV_Handler(void);
void SysTick_Handler(void);

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/

/******************************************************************************/
/*            Cortex-M0+ Processor Exceptions Handlers                         */
/******************************************************************************/

/**
 * @brief   This function handles NMI exception.
 * @param  None
 * @retval None
 */
void NMI_Handler(void)
{
  /* Go to infinite loop when Hard Fault exception occurs */
  while (1)
  {
  }
}

/**
 * @brief  This function handles Hard Fault exception.
 * @param  None
 * @retval None
 */
void HardFault_Handler(void)
{
  /* Go to infinite loop when Hard Fault exception occurs */
  while (1)
  {
  }
}

/**
 * @brief  This function handles SVC exception.
 * @param  None
 * @retval None
 */
void SVC_Handler(void)
{
}

/**
 * @brief  This function handles PendSVC exception.
 * @param  None
 * @retval None
 */
void PendSV_Handler(void)
{
}

/**
 * @brief  This function handles SysTick exception.
 * @param  None
 * @retval None
 */
void SysTick_Handler(void)
{
	SysTick_Handler_soft();
}

/**
 * @brief  This function handles EXTI exception.
 * @param  None
 * @retval None
 */
void EXTI9_4_Handler(void)
{
	if(EXTI_GetPendingFlagStatus(EXTI_Line4) == SH_SET)
	{
	//	if(Get_Stove_delay() ==0)
		//{
			Api_Knob_CheckDirection();
			Api_Knob_ClearKnobCount();
			Api_Knob_CheckKnobPulseNum();
		//}
		EXTI_ClearPendingFlag(EXTI_Line4);
	}
//  if (EXTI_GetPendingFlagStatus(EXTI_Line12) == SH_SET)
//  {
//    EXTI_ClearPendingFlag(EXTI_Line12);
//  }
}

/************************ (C) COPYRIGHT Sinowealth *****END OF FILE****/
